package com.diandian.backend.douyin.life.exchange.req;

import com.diandian.base.boot.starter.exception.DefaultException;

import java.io.Serializable;
import java.util.Date;

public class MemberMobileChangeReq implements Serializable {

    private String openId; // 用户/会员 openId
    private String newMobile; // 新手机号
    private Long updateTime; // 数据更新时间（秒时间戳）

    public void check(){
        if(this.openId == null || "".equals(this.openId)){
            throw new DefaultException("openId不能为空");
        }
        if(this.newMobile == null || "".equals(this.openId)){
            throw new DefaultException("新手机号不能为空");
        }
        if(this.updateTime == null){
            updateTime = new Date().getTime() / 1000;
        }
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getNewMobile() {
        return newMobile;
    }

    public void setNewMobile(String newMobile) {
        this.newMobile = newMobile;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }
}
